package com.lx.listener;

import com.github.sonus21.rqueue.annotation.RqueueListener;
import com.lx.model.Email;
import com.lx.model.Invoice;

import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 段誉
 * @create 2019-11-22 13:28
 */
@Component
@Slf4j
public class MessageListener {
  @RqueueListener(value = "${email.queue.name}")
  public void sendEmail(Email email) {
    log.info("Email {}", email);
  }

  @RqueueListener(delayedQueue = "true", value = "${invoice.queue.name}")
  public void generateInvoice(Invoice invoice) {
    log.info("Invoice {}", invoice);
  }
}
